package 实践.class_07.Demo_01;

class Truck extends Vehicle{
    //载货量
    private int cargocap;
    //构造方法
    public Truck() {
    }

    public Truck(int passengers, int fuelcap, int mpg, int cargocap) {
        super(passengers, fuelcap, mpg);
        this.cargocap = cargocap;
    }

    /**
     * 获取
     * @return cargocap
     */
    public int getCargo() {
        return cargocap;
    }

    /**
     * 设置
     * @param cargocap
     */
    public void setCargo(int cargocap) {
        this.cargocap = cargocap;
    }
}


